
-- 微信银行
local t_ip_pool_weixin = {
    "10.3.130.1", 
    "10.3.130.6",
}

-- 网上银行
local t_ip_pool_wangyin = {
	"10.0.116.220",
	"10.0.116.222",
    "10.0.116.216",
    "10.0.116.218",
	"10.3.130.88",
	"10.3.130.90",
	"10.3.130.92",
	"10.3.130.94",
}

-- 直销银行
local t_ip_pool_zhixiao = {
    "10.3.130.96",
	"10.3.130.98",
    "10.0.116.224",
	"10.0.116.226",
	"10.0.116.1",
	"10.0.116.6",
}

-- 手机银行
local t_ip_pool_shouji = {
    "10.0.116.7",
	"10.3.130.37",
    "10.0.116.200",
	"10.0.116.205",
	"10.0.116.14",
	"10.0.116.15",
}

-- 自助
local t_ip_pool_zizhu = {
    "10.0.1.106",
}

-- 特色业务
local t_ip_pool_tese = {
    "10.0.116.68",
	"10.0.116.69",
	"10.0.116.72",
	"10.3.130.40",
	"10.3.130.41",
	"10.0.116.208",
	"10.0.116.210",
    "10.0.116.92",
	"10.0.118.5",
	"10.0.118.10",
	"10.0.116.162",
	"10.0.116.164",
	"10.0.116.166",
}

string.split = string.split or function(input, delimiter)
    input = tostring(input)
    delimiter = tostring(delimiter)
    if (delimiter=='') then return false end
    local pos,arr = 0, {}
    -- for each divider found
    for st,sp in function() return string.find(input, delimiter, pos, true) end do
        table.insert(arr, string.sub(input, pos, st - 1))
        pos = sp + 1
    end
    table.insert(arr, string.sub(input, pos))
    return arr
end

function ip2long(ip)
    local ips = string.split(ip,".")
    local num = 0
    for i,v in pairs(ips) do
        num = num +(tonumber(v) * math.pow(256,#ips-i))
    end
    return num
end

print("微信银行")
for k, v in pairs(t_ip_pool_weixin) do
    print(v .. " = " .. ip2long(v))
end

print("\n网上银行")
for k, v in pairs(t_ip_pool_wangyin) do
    print(v .. " = " .. ip2long(v))
end

print("\n直销银行")
for k, v in pairs(t_ip_pool_zhixiao) do
    print(v .. " = " .. ip2long(v))
end

print("\n手机银行")
for k, v in pairs(t_ip_pool_shouji) do
    print(v .. " = " .. ip2long(v))
end

print("\n自助")
for k, v in pairs(t_ip_pool_zizhu) do
    print(v .. " = " .. ip2long(v))
end

print("\n特色业务")
for k, v in pairs(t_ip_pool_tese) do
    print(v .. " = " .. ip2long(v))
end